angular.module('app').directive('appTab', [function () {
    return {
        restrict: 'AE',
        replace: true,
        transclude: true,
        templateUrl: 'view/template/tab.html',
        scope: {
            data : '=',
            tabList: '=',
            tClick: '&'
        },
        link: function ($scope, element, attrs) {
            $scope.currentIndex = 0;
            $scope.tabClick = function(index, item){
                if(index == $scope.currentIndex) return;
                $scope.currentIndex = index;

            }

        }
    };
}]);